function shallowMerge(obj1, obj2) {
  if (!isObj(obj1)) return obj2;
  if (!isObj(obj2)) return obj1;

  for (let key in obj2) {
    obj1[key] = obj2[key];
  }

  return obj1;
}

console.log('浅合并--shallowMerge', shallowMerge(obj1, obj));
console.log('浅合并--对象扩展运算符', { ...obj2, ...obj });
console.log('浅合并--Object.assign', Object.assign(obj3, obj))
